package com.kyin.satoken.controller;

import cn.dev33.satoken.stp.StpUtil;
import com.kyin.satoken.common.R;
import com.kyin.satoken.service.LoginService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author yin.kai
 * @ClassName LoginController
 * @description: 类描述
 * @date 2025/9/23 16:59
 * @version: 1.0
 */
@RestController
@RequestMapping("/sys")
public class LoginController {
    @Resource
    private LoginService loginService;

    @PostMapping("/login")
    public R login(@RequestBody Map<String ,Object> params){
        return  loginService.login(params);
    }

    @PostMapping("/info")
    public R info(){
        return R.ok(StpUtil.getLoginId());
    }
}
